/*
 * 	Flan.Zeng 2011-2016	http://git.oschina.net/signup?inviter=flan
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.flan.stock.activity;

import java.util.ArrayList;

import com.flan.stock.R;
import com.flan.stock.adapter.QuotationFragmentAdapter;
import com.flan.stock.fragment.FragmentStockFenShi;
import com.flan.stock.view.FooterMenuView;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.ViewPager;

/**
 * 显示股市详情（分时走势，K线）的窗口类
 * @author flan
 * @date   2015年10月30日
 */
public class StockDetailActivity extends FragmentActivity {
	
	private ViewPager viewPager;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		this.setContentView(R.layout.activity_stockdetail);
		
		//初始化底部菜单控件
		FooterMenuView menu = (FooterMenuView) this.findViewById(R.id.footer_menu);
		menu.setCurrentMenu(R.id.menu_hangqing);
		menu.setOnTouchListener(menu.new MenuOnTouchListener());
		
		viewPager = (ViewPager) this.findViewById(R.id.vp_fragment);
		//viewPager.setAdapter(new WelcomeAdapter(getPagers()));
		viewPager.setAdapter(new QuotationFragmentAdapter(getSupportFragmentManager(),createFragments()));
		
	}
	
	private ArrayList<Fragment> createFragments(){
		
		ArrayList<Fragment> list = new ArrayList<>();
		
		FragmentStockFenShi fs = new FragmentStockFenShi();
		
		list.add(fs);
		
		return list;
	}
	
}
